package com.example.demo.web.api;

import com.example.demo.constant.RequestUrl;
import com.example.demo.param.OperatorFindAllParam;
import com.example.demo.param.OperatorSaveParam;
import com.example.demo.param.OperatorUpdateParam;
import com.example.demo.vo.ApiResult;
import com.example.demo.vo.OperatorPageVO;
import com.example.demo.vo.OperatorVO;
import com.example.demo.vo.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 *@Description 操作员接口
 *@Author Levi
 *@Date 2019/4/23-16:20
*/
@RequestMapping(value = RequestUrl.API + RequestUrl.OPERATOR)
@Api(value = "操作员接口", tags = "操作员接口")
public interface OperatorApi {

    @PostMapping()
    @ApiOperation(value="添加操作员")
    ApiResult<Long> save(@RequestBody OperatorSaveParam operatorSaveParam) throws Exception;

    @PutMapping()
    @ApiOperation(value="更新操作员")
    ApiResult<Long> update(@RequestBody OperatorUpdateParam operatorUpdateParam) throws Exception;

    @GetMapping(value = "/{id}")
    @ApiOperation(value="查看操作员")
    ApiResult<OperatorVO> findById(@PathVariable("id") Long id) throws Exception;

    @GetMapping()
    @ApiOperation(value="查询操作员")
    ApiResult<PageVO<OperatorPageVO>> findAll(OperatorFindAllParam operatorFindAllParam) throws Exception;

    @DeleteMapping(value = "/{id}")
    @ApiOperation(value="删除操作员")
    ApiResult<Long> deleteById(@PathVariable("id") Long id) throws Exception;
}
